if(${BUILD_DOC})

add_custom_target( daemons.sgml ALL "${CMAKE_SOURCE_DIR}/script/dmn2sgml.py" "${CMAKE_SOURCE_DIR}/parcook" > ${CMAKE_CURRENT_BINARY_DIR}/daemons.sgml )

add_custom_target( draw3_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" draw3 )
add_custom_target( draw3_en_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" draw3_en )
add_custom_target( eksploatacja_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" eksploatacja )
add_custom_target( ekstraktor3_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" ekstraktor3 )
add_custom_target( howto_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" howto )
add_custom_target( ipk_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" ipk DEPENDS daemons.sgml )
add_custom_target( oszarpie_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" oszarpie )
add_custom_target( raporter_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" raporter )
add_custom_target( scc_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" scc )
add_custom_target( ssc_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" ssc )
add_custom_target( filler_html ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_html.sh" filler )

add_custom_target( draw3_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" draw3 )
add_custom_target( draw3_en_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" draw3_en )
add_custom_target( eksploatacja_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" eksploatacja )
add_custom_target( ekstraktor3_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" ekstraktor3 )
add_custom_target( howto_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" howto )
add_custom_target( ipk_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" ipk DEPENDS daemons.sgml )
add_custom_target( oszarpie_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" oszarpie )
add_custom_target( raporter_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" raporter )
add_custom_target( scc_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" scc )
add_custom_target( ssc_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" ssc )
add_custom_target( filler_pdf ALL "${CMAKE_CURRENT_SOURCE_DIR}/make_pdf.sh" filler )

install( FILES "${CMAKE_CURRENT_BINARY_DIR}/style.css" DESTINATION "${SZARP_SHAREDIR}/documentation/new/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/common" DESTINATION "${SZARP_SHAREDIR}/documentation/new/" )

install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/draw3/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/draw3/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/draw3_en/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/draw3_en/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/eksploatacja/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/eksploatacja/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/ekstraktor3/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/ekstraktor3/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/howto/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/howto/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/ipk/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/ipk/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/oszarpie/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/oszarpie/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/raporter/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/raporter/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/scc/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/scc/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/ssc/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/ssc/" )
install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/filler/html" DESTINATION "${SZARP_SHAREDIR}/documentation/new/filler/" )

install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pdf" DESTINATION "${SZARP_SHAREDIR}/documentation/new/" )

endif()
